/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-06-04
 * Time: 19:17
 */
class Solution {
    /*public int removeDuplicates(int[] nums) {
        int len = nums.length;
        int[] array = new int[len];
        int newIndex = 0;
        for (int i = 0; i < len; i++) {
            boolean flg = false;
            for (int j = 0; j < len; j++) {
                if(nums[i] == nums[j] && i != j) {
                    flg = true;
                }
            }
            if(flg == false) {
                array[newIndex] = nums[i];
                newIndex++;
            }
        }
        for (int i = 0; i < newIndex; i++) {
            nums[i] = array[i];
        }
        return newIndex;
    }*/
    public int removeDuplicates(int[] nums) {
        int len = nums.length;
        int[] array = new int[len];
        int count = 0;
        for (int i = 0; i < len; i++) {
            boolean flg = true;
            for (int j = 0; j < count; j++) {
                if(nums[i] == array[j]) {
                    flg = false;
                }
            }
            if(flg == true) {
                array[count] = nums[i];
                count++;
            }
        }
        for (int i = 0; i < count; i++) {
            nums[i] = array[i];
        }
        return count;
    }

    public static void main(String[] args) {
        Integer a = 200;
        System.out.println(a);
    }
}